using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LogisticsAndong.Entity;
using LogisticsAndong.Model;
using LogisticsAndong.Service;
using Leeder.Business;

namespace LogisticsAndong.Business
{
    /// <summary>
    /// 
    /// </summary>
   public class PlanMonitorBLL : BaseBLL<PlanMonitorModel, PlanMonitorService>
   {
        public PlanMonitorBLL()
        {
            Service = new PlanMonitorService();
        }

        public List<PlanMonitorModel> GetModelList()
        {
            return Service.Query(p => (!p.IsPhantom || p.IsPhantom == null)).ActivedObj;
        }

        public List<PlanMonitorModel> GetModelListByCondition(DateTime startDate, DateTime endDate, string jdType)
        {
            if (string.IsNullOrEmpty(jdType))
                return Service.Query(p => p.CreateTime >= startDate && p.CreateTime <= endDate).ActivedObj;
            else
                return Service.Query(p => p.CreateTime >= startDate && p.CreateTime <= endDate && p.AreaName == jdType).ActivedObj;
        }
    }
}
